/**
 * 
 */
package qy.jalgotrade.optimizer.xmlrpc;

import java.io.Serializable;
import java.util.List;

import qy.jalgotrade.optimizer.base.Parameters;

/**
 * 包含 一组回测参数集, 即 [(p1, p2, ...), ...] (每组所包含参数集的数量, 取决于 batchSize):
 * 
 * @author c-geo
 *
 */
public class Job implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1247238427741996852L;

	private List<Parameters> __strategyParameters;

	private int __id;

	/**
	 * 
	 */
	public Job(List<Parameters> strategyParameters) {

		__strategyParameters = strategyParameters;
		__id = hashCode();
	}

	/**
	 * 
	 * @return
	 */
	public int getId() {

		return __id;
	}

	/**
	 * 
	 * @return
	 */
	public Parameters getNextParameters() {

		Parameters ret = null;
		if (__strategyParameters.size() > 0) {
			ret = __strategyParameters.remove(__strategyParameters.size() - 1);
		}
		return ret;
	}
}
